Author: Charles Tapley Hoyt
Estimated Run Time: 5 seconds
This notebook shows how ontological relationships, such as chemical families and enzyme classes, can be used to make inferences in knowledge assemblies using the infer_child_relations mutations function.
In [1]:
import time
import sys
import random
from pybel.utils import get_version
from pybel.struct.mutation import infer_child_relations
from pybel_tools.visualization import *
from pybel.examples.statin_example import statin_graph, hmgcr_inhibitor, hmgcr, ec_11134
In [2]:
print(time.asctime())
In [3]:
print(sys.version)
In [4]:
# Set seed for visualization
random.seed(127)
In [5]:
print(get_version())
This notebook uses a small example related to statins and their target, HMG-CoA_reductase. While it is not exhaustively importing relationships using Bio2BEL ExPASy and Bio2BEL ChEBI, it still provides an atomic example on how in- and out-edges can be inferred through hierarchies.
In [6]:
to_jupyter(statin_graph)
Out[6]:
The first transformation made is to assert that all things true for EC 1.1.1.34/EC 1.1.88 inhibitors are also true for their descendants. There are two relationships showing decrease in the activities of the corresponding enzyme nodes that will be asserted for its two children, statin and mevinolinic acid, as well as recursively for their descendants.
In [7]:
infer_child_relations(statin_graph, hmgcr_inhibitor)
to_jupyter(statin_graph)
Out[7]:
While EC 1.1.1.34 has several proteins across many species annotated in ExPASy, HMGCR is normalized to its HGNC nomenclature and used as the only example in this graph. Since HMGCR is an EC 1.1.1.34, all of the relationships with this enzyme node are transferred below.
In [8]:
infer_child_relations(statin_graph, ec_11134)
to_jupyter(statin_graph)
Out[8]:
The simple interface provided by the infer_child_relations
function allows for graphs to be completed.
Another possibility is to propogate relationships the other direction through hierarchies. Sometimes, it might be reasonable to guess that a property of an invididual might be true for its parent as well, and then even also true for its siblings.